package com.shusl.controller;

import com.shusl.mapper.SysUserRoleMapper;
import com.shusl.pojo.SysUserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class SysUserRoleController {
    @Autowired
    SysUserRoleMapper sysUserRoleMapper;

    // 查询全部
    @GetMapping("/getSysUserRoles")
    public List<SysUserRole> getSysUserRoles(){
        return sysUserRoleMapper.getSysUserRoles();
    }

    // 查询根据id
    @GetMapping("/getSysUserRole/{id}")
    public SysUserRole getSysUserRole(@PathVariable("id") Integer id){
        return sysUserRoleMapper.getSysUserRole(id);
    }
}
